package com.hst.capacity.infra.persistence.jpa.auth;


import com.hst.capacity.domain.model.entity.auth.TcAuthEntity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface TcAuthRepository extends CrudRepository<TcAuthEntity, String> {

    List<TcAuthEntity> findByIdFranchiseeAndClientType(String idFranchisee, int clientType);

    @Query("SELECT t.idFranchisee FROM TcAuthEntity t WHERE t.idChannel = ?1")
    List<String> findIdFranchiseeByIdChannel(String idChannel);

    @Query("SELECT t FROM TcAuthEntity t WHERE t.idChannel = ?1 AND t.regionCode = ?2 AND t.clientType = 10")
    TcAuthEntity findByIdChannelAndRegionCode(String idChannel, String regionCode);

}
